/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Formularios2;


import Atributos.*;
import BD.CriaConexao;
import Metodos.*;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;

/**
 *
 * @author Andre
 */
public class Horario2 extends javax.swing.JFrame {
ProfessorDiasMet profdiasmet=new ProfessorDiasMet();
MinimizaTela tela= new MinimizaTela();  
ProfessorDias pd=new ProfessorDias();
Professor prof=new Professor();
ProfessorMet profmet=new ProfessorMet();
Disciplina disc=new Disciplina();
DisciplinaMet discmet=new DisciplinaMet();
HorasAula ha=new HorasAula();
HorasAulaMet hamet=new HorasAulaMet();
SerieMet seriemet = new SerieMet();
Serie s = new Serie();
List<Serie> listaS;
List<Professor> listaP;
static private String[] nomes_serie;
public static int ver1, ver2, ver3,ver4,ver5,ver6,ver7,ver8;
static Objeto obj=new Objeto();
Objeto obj2=new Objeto();
Objeto obj3=new Objeto();
ObjetoMet objmet=new ObjetoMet();
 List<Objeto> listaO;
List<Objeto> listaO2;
List<Objeto> listaO3;
static String professor,materia;
JTable jTable1 = new javax.swing.JTable();
JTable jTable2 = new javax.swing.JTable();
static String prof1="",prof2="",prof3="";
static File arquivo;
    /**
     * Creates new form Horario
     */
    public Horario2() {
        TransfereDados(1);
       int j=BuscarJ();
        String[] asd=BuscarSerieTurma();
        initComponents(); 
        BufferedImage image=null;
        File imageFile=new File(".\\src\\Imagens\\sghverde3.png");
        try {
            image=ImageIO.read(imageFile);
            
        } catch (IOException ex) {
        }
        jDialog1.setIconImage(image);
        JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
        JScrollPane jScrollPane2 = new javax.swing.JScrollPane();       
                jTable2.setModel(new javax.swing.table.DefaultTableModel(
    new Object [59][j],
    asd
));
jTable2.setBackground(Color.black);
jTable2.setForeground(Color.WHITE);
jTable2.setGridColor(Color.ORANGE);
jScrollPane2.setViewportView(jTable2);

        javax.swing.GroupLayout layout2 = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout2);
        layout2.setHorizontalGroup(
            layout2.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout2.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 1000, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout2.setVerticalGroup(
            layout2.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout2.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 59, Short.MAX_VALUE))
        );
        
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object [59][j],
    asd
));
jTable1.setBackground(Color.black);
jTable1.setForeground(Color.WHITE);
jTable1.setGridColor(Color.ORANGE);
jScrollPane1.setViewportView(jTable1);
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1000/*1400*/, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 500/*823*/, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 59, Short.MAX_VALUE))
        );
         this.setExtendedState(MAXIMIZED_BOTH);
         if(EstagiosTabela.id==1){
             System.out.println("insere estagio");
            InsereEstagios();
             System.out.println("insere 3 ano");
                Insere3ano();
            
      }
         System.out.println("insere outras turmas");
         InsereTurmasRestantes();//esse metodo insere as turmas que nao estão em estagio
         
        System.out.println("insereaulas restantes");
         InsereasAulasQueResta();//esse metodo pega as aulas com pendencia de dias disponiveis e aloca na tabela
         System.out.println("contando quant de de aulas alocadas");
         int indice=0;
        for(int l=0;l<j;l++){
            for(int i=0;i<59;i++){
                if(jTable1.getModel().getValueAt(i,l)!=null){
                    indice++;
                }
                
            }
        }   
      
      if(indice==(45*j) || indice==(45*j)+5 || indice==(45*j)+10 || indice==(45*j)+15 || indice==(45*j)+20 || indice==(45*j)+25 || indice==(45*j)+30 || indice==(45*j)+35 || indice==(45*j)+40){
         EnviaDadosRelProf(j);    
        SubstituiNomes(j);//pega o nome das disciplinas profissionais que estão na tabela e substitui por DP
            EnviarDadosParaBD(j);//emvia os dados da tabela depois dela esta preenchiada  
           Envia_Rel_Turmas(j);//envia os dados para o relatorio de cada turma separadamente
           TransfereDados(2);  
          JOptionPane.showMessageDialog(rootPane, "<html>Selecione um local para os arquivos serem salvos<br>Caso não selecione nada, o Horário não será salvo");
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        jDialog1.setBounds((screenSize.width-625)/2, (screenSize.height-430)/2, 625, 430);
        jDialog1.setVisible(true);
           
            
      }
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDialog1 = new javax.swing.JDialog();
        jFileChooser1 = new javax.swing.JFileChooser();

        jFileChooser1.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY);
        jFileChooser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileChooser1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser1ActionPerformed
        int j=BuscarJ();
        arquivo = jFileChooser1.getSelectedFile();
        jDialog1.setVisible(false);
        if(arquivo!=null){
        String adober;
        adober = String.valueOf(arquivo);
        File pasta = new File(adober+"/Relatorios");
            pasta.mkdir();
            adober=adober+"/Relatorios";
        System.out.println(adober);
        if (!adober.equals("null")) {
            System.out.println("akii");
            try {
                Connection con = (Connection) CriaConexao.getConexao();
                HashMap parametros = new HashMap();
                File f=new File(adober+"/Horario Geral");
              f.delete();
                    System.out.println("deletou");
                File dir = new File(adober+"/Horario Geral");
               dir.mkdir();
               if(!adober.equals("null")){
                   System.out.println("criou");
                   String adober2;
                    adober2 = String.valueOf(dir);
                if(j==1){
                    
        
                  JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario1.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 1");  
                }
                if(j==2){
                  JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario2.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 2");    
                }
                if(j==3){
                  JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario3.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 3");    
                }
                if(j==4){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario4.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 4");   
                }
                if(j==5){
                  JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario5.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 5");    
                }
                if(j==6){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario6.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 6");  
                }
                if(j==7){
                  JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario7.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 7");    
                }
                if(j==8){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario8.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 8");   
                }
                if(j==9){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario9.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 9");   
                }
                if(j==10){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario10.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 10");   
                }
                if(j==11){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario11.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                            
                        JasperExportManager.exportReportToPdfFile(jp, adober2 + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 11");
                }
                if(j==12){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario12.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 12"); 
                }
                if(j==13){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario13.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 13"); 
                }
                if(j==14){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario14.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 14");
                }
                if(j==15){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario15.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 15");
                }
                if(j==16){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario16.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 16"); 
                }
                if(j==17){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario17.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 17"); 
                }
                if(j==18){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario18.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 18");
                }
                if(j==19){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario19.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 19");
                }if(j==20){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario20.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 20");
                }
                if(j==21){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario21.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 21");
                }
                if(j==22){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario22.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 22"); 
                }
                if(j==23){
                   JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario23.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 23"); 
                }
                if(j==24){
                    JasperPrint jp = null;
                    try {
                        jp = JasperFillManager.fillReport("./src/Relatorios/Horario24.jasper", parametros, con);
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    try {
                        JasperExportManager.exportReportToPdfFile(jp, adober + "/Horario.pdf");
                    } catch (JRException ex) {
                        Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    System.out.println("salvou horario 24");
                }
            }
            
               File f2=new File(adober+"/Horario por Professor");
                f2.delete();
                
               File dir2 = new File(adober+"/Horario por Professor");
               dir2.mkdir();
               
                   String adober2;
                    adober2 = String.valueOf(dir2);
              listaP=profmet.BuscaTodosProf();  
              for(int i=0;i<listaP.size();i++){
              prof=listaP.get(i);    
                  parametros.put("par1", prof.getId());
                  parametros.put("logo", getClass().getResourceAsStream("iconebarra.png"));
                  
                 
                    JasperPrint jp = null; 
                try {
                    jp = JasperFillManager.fillReport("./src/Relatorios/Professor.jasper", parametros,con);
                } catch (JRException ex) {
                    Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                }
                try {
                    JasperExportManager.exportReportToPdfFile(jp, adober2+"/"+prof.getNome()+".pdf");
                } catch (JRException ex) {
                    Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                }
                System.out.println("salvou "+prof.getNome());
              }  
               
                
              File f3=new File(adober+"/Horario por Turma");
              f3.delete();
                
              File dir3 = new File(adober+"/Horario por Turma");
               dir3.mkdir();
                   String adober3;
                    adober3 = String.valueOf(dir3);
              HashMap parametros2 = new HashMap();
              listaS=seriemet.BuscaDadosRelTurmas();  
              for(int i=0;i<listaS.size();i++){
              s=listaS.get(i);    
                  parametros2.put("id_serie", s.getId());
                  parametros2.put("nome_serie", s.getNome()+s.getTurma());
                  parametros2.put("nome_curso", s.getCurso());
                  parametros2.put("logo", getClass().getResourceAsStream("iconebarra.png"));
                  System.out.println(s.getId()+"-"+s.getNome()+s.getTurma()+"-"+s.getCurso()+"-"+getClass().getResourceAsStream("iconebarra.png"));   
                 
                    JasperPrint jp = null; 
                try {
                    jp = JasperFillManager.fillReport("./src/Relatorios/Relatorio_turmas.jasper", parametros2,con);
                } catch (JRException ex) {
                    Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                }
                try {
                    JasperExportManager.exportReportToPdfFile(jp, adober3+"/"+s.getNome()+s.getTurma()+".pdf");
                } catch (JRException ex) {
                    Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
                }
                System.out.println("salvou "+s.getNome()+s.getTurma());
              }  
               
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }

        
        
        JOptionPane.showMessageDialog(rootPane, "Tabela Horário, Horário por Professor e Horário por Turma gerados com sucesso");
        
        }
        }
        try {
            objmet.DeletarTabHorarioTabRelProf();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
                objmet.atualiza_id_gerar(1);
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
        
    }//GEN-LAST:event_jFileChooser1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        
       

        
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new Horario2().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDialog jDialog1;
    private javax.swing.JFileChooser jFileChooser1;
    // End of variables declaration//GEN-END:variables

    private void TransfereDados(int esc) {
        if(esc==1){
            
            try {
                objmet.DeletarTabHorarioTabRelProf();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.PassapraTab2();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.Passapratab2DiasAulas();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.PassapraTab2prof();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
        }else{
            try {
                objmet.DeletaTabHA();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.RepassapraTab1();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.RepassapraTab1DiasAulas();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                objmet.RepassapraTab1prof();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    } 
    
    private void SubstituiNomes(int x) {
        for(int i=0;i<59;i++){
            for(int y=0;y<x;y++){
               String disciplina=String.valueOf(jTable1.getModel().getValueAt(i,y));
               if(discmet.VerificaseProfisional(disciplina)){
                   jTable1.getModel().setValueAt("DP",i,y);
               }
            }
        }
    }   
    
private void EnviarDadosParaBD(int j) {
       String[] asd=BuscarSerieTurma(); 
       List<EnviarAoBD> minhaLista;
            
        minhaLista = new ArrayList<>();
        for(int i=0;i<asd.length+1;i++){
            EnviarAoBD a1 = new EnviarAoBD(); 
            if(i==0){
             a1.setAnoturma("");
        
        minhaLista.add(a1); 
            }else{
        
        a1.setAnoturma(asd[i-1]);
        
        minhaLista.add(a1);
            }
        }
        
        try {
                objmet.AdicionaRelatorioTurmas(minhaLista);
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
       String a1="1ª",b1="2ª",c1="3ª",d1="4ª",e1="5ª",f1="6ª",g1="7ª",h1="8ª",i1="9ª",j1="10ª";
        
        for(int i=0;i<59;i++){
        
        minhaLista = new ArrayList<>();
            for(int l=0;l<j;l++){
            EnviarAoBD a2 = new EnviarAoBD(); 
            if(l==0 && i==0 || l==0 && i==12 || l==0 && i==24 || l==0 && i==36 || l==0 && i==48){
                a2.setId_aula(a1);
                minhaLista.add(a2);   
            }if(l==0 && i==1 || l==0 && i==13 || l==0 && i==25 || l==0 && i==37 || l==0 && i==49){
                a2.setId_aula(b1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==2 || l==0 && i==14 || l==0 && i==26 || l==0 && i==38 || l==0 && i==50){
                a2.setId_aula(c1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==3  || l==0 && i==15 || l==0 && i==27 || l==0 && i==39 || l==0 && i==51){
                a2.setId_aula(d1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==4  || l==0 && i==16 || l==0 && i==28 || l==0 && i==40 || l==0 && i==52){
                a2.setId_aula(e1);
                minhaLista.add(a2);   
            } 
            
            if(l==0 && i==6  || l==0 && i==18 || l==0 && i==30 || l==0 && i==42 || l==0 && i==54){
                a2.setId_aula(f1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==7  || l==0 && i==19 || l==0 && i==31 || l==0 && i==43 || l==0 && i==55){
                a2.setId_aula(g1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==8  || l==0 && i==20 || l==0 && i==32 || l==0 && i==44 || l==0 && i==56){
                a2.setId_aula(h1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==9  || l==0 && i==21 || l==0 && i==33 || l==0 && i==45 || l==0 && i==57){
                a2.setId_aula(i1);
                minhaLista.add(a2);   
            } 
            if(l==0 && i==10 || l==0 && i==22 || l==0 && i==34 || l==0 && i==46 || l==0 && i==58){
                a2.setId_aula(j1);
                minhaLista.add(a2);   
            } 
            if(jTable2.getModel().getValueAt(i, l)==null){
                a2.setAula1(String.valueOf(jTable1.getModel().getValueAt(i, l)));
                minhaLista.add(a2);
            }else{
            a2.setAula1(jTable1.getModel().getValueAt(i, l)+" - "+jTable2.getModel().getValueAt(i, l)); 
            
            minhaLista.add(a2);   
            }
              
                  
                
            }
            try {
                objmet.AdicionaRelatorio(minhaLista);
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
            
        }
    }    

private int BuscarJ() {
        int j;j=seriemet.BuscarQuantdeSerie();return j;
    }

private String[] BuscarSerieTurma() {         
         listaS = null;
        try {
            listaS = seriemet.getList();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);}
       String[]  nomes_turma = new String [listaS.size()];
       String[]  nomes_ano = new String [listaS.size()];
       nomes_serie = new String [listaS.size()];
       int[] id_series = new int [listaS.size()];
        int i=0;   
        while(listaS.size()>i){
        s = listaS.get(i);
        id_series[i] = s.getId();
        nomes_ano[i] = s.getNome();
        nomes_turma[i] = s.getTurma();
        nomes_serie[i] = nomes_ano[i] + nomes_turma[i];
        System.out.println("nome: " + nomes_serie[i]);
        i++;
        }       
        return nomes_serie;
}

private void InsereEstagios() {
        String[] a=EstagiosTabela.getEstagioA();
        String[] b=EstagiosTabela.getEstagioB();
        String[] c=EstagiosTabela.getEstagioC();
        String[] d=EstagiosTabela.getEstagioD();
        String[] e=EstagiosTabela.getEstagioE();
        String[] f=EstagiosTabela.getEstagioF();
        String[] g=EstagiosTabela.getEstagioG();
        String[] h=EstagiosTabela.getEstagioH();
           
        if(a[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( a[0].equals(nomes_serie[i])){
            ver1=i;
             System.out.println("dia: "+ver1);
        }   
        }
        }
        if(b[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( b[0].equals(nomes_serie[i])){
            ver2=i;
            System.out.println("dia: "+ver2);
        }   
        }
        }
        if(c[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( c[0].equals(nomes_serie[i])){
            ver3=i;
            System.out.println("dia: "+ver3);
        }   
        }
        }
        if(d[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( d[0].equals(nomes_serie[i])){
            ver4=i;
        }   
        }
        }
        if(e[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( e[0].equals(nomes_serie[i])){
            ver5=i;
        }   
        }
        }
        if(f[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( f[0].equals(nomes_serie[i])){
            ver6=i;
        }   
        }
        }
        if(g[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( g[0].equals(nomes_serie[i])){
            ver7=i;
        }   
        }
        }
        if(h[1]!=null){
        for(int i=0;listaS.size()>i;i++){
         if( h[0].equals(nomes_serie[i])){
            ver8=i;
        }   
        }
        }
        
        if(a!=null && "Manhã".equals(a[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver1);
         
        }
        if(a!=null && "Tarde".equals(a[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver1);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver1);
        }
        if(b!=null && "Manhã".equals(b[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver2);
        }
        if(b!=null && "Tarde".equals(b[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver2);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver2);
        }
        if(c!=null && "Manhã".equals(c[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver3);
        }
        if(c!=null && "Tarde".equals(c[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver3);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver3);
        }
        if(d!=null && "Manhã".equals(d[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver4);
        }
        if(d!=null && "Tarde".equals(d[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver4);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver4);
        }
        if(e!=null && "Manhã".equals(e[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver5);
        }
        if(e!=null && "Tarde".equals(e[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver5);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver5);
        }
        if(f!=null && "Manhã".equals(f[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver6);
        }
        if(f!=null && "Tarde".equals(f[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver6);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver6);
        }
        
        if(g!=null && "Manhã".equals(g[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver7);
        }
        if(g!=null && "Tarde".equals(g[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver7);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver7);
        }
        
        if(h!=null && "Manhã".equals(h[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 0,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 1,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 2,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 3,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 4,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 12,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 13,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 14,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 15,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 16,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 24,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 25,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 26,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 27,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 28,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 36,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 37,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 38,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 39,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 40,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 48,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 49,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 50,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 51,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 52,ver8);
        }
        if(h!=null && "Tarde".equals(h[1])){
         jTable1.getModel().setValueAt("ESTAGIO", 6,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 7,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 8,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 9,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 18,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 19,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 20,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 21,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 30,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 31,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 32,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 33,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 42,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 43,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 44,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 45,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 54,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 55,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 56,ver8);
         jTable1.getModel().setValueAt("ESTAGIO", 57,ver8);
    
        }
    }

private void Insere3ano() {
        try {
            System.out.println("insere 3 ano 10m aula");
            Insere3anoDecimaAula();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            System.out.println("insere 3 ano 2 aulas");
            Insere3ano2aulas();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            System.out.println("insere 3 ano 1 aula");
            Insere3ano1aula();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

private void InsereasAulasQueResta() {
int i=0;
while(!listaO.isEmpty()){
//for(int y=0;y<30;y++){
   
        
        try {
            RemoveInsere();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            RemoveInsere2();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        i++;
        try {
                listaO=objmet.CriaListObj();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
        if(listaO.isEmpty()){
           try {
            objmet.RepassapraTab1DiasAulas2();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }  
        }
        if(i==3){
                 i=0;
             try {
            objmet.RepassapraTab1DiasAulas2();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
             }
            try {
                listaO=objmet.CriaListObj();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
    }
//try {
//                listaO=objmet.CriaListObj();
//            } catch (SQLException ex) {
//                Logger.getLogger(Horario.class.getName()).log(Level.SEVERE, null, ex);
//            }
//if(!listaO.isEmpty()){
//            try {
//                DeslocaAulas();
//            } catch (SQLException ex) {
//                Logger.getLogger(Horario.class.getName()).log(Level.SEVERE, null, ex);
//            }
//    }
            try {
                listaO=objmet.CriaListObj();
            } catch (SQLException ex) {
                Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
            }
//}
    }

    private void Insere3anoDecimaAula () throws SQLException {
        listaO=objmet.CriaListObjPara3ano10aula();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                obj=listaO.get(w);               
                
                    
                    
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){   
                        
                        if(obj.getDia()==1){
                           if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO"){
                            int y=10;
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                Insere3anoDecimaAula();
                                            } 
                                    } 
                           
                            }
                        }
                        if(obj.getDia()==2){                          
                            if(jTable1.getModel().getValueAt(12,z)=="ESTAGIO"){
                                    int y=22;
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3anoDecimaAula();
                                            } 
                                    } 
                                        }
                                                                
                        }
                        if(obj.getDia()==3){
                            if(jTable1.getModel().getValueAt(24,z)=="ESTAGIO"){
                                int y=34;
                                  
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3anoDecimaAula();
                                            } 
                                    } 
                                        }
                             
                        }
                        if(obj.getDia()==4){
                                if(jTable1.getModel().getValueAt(36,z)=="ESTAGIO"){
                                    int y=46;
                                        
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3anoDecimaAula();
                                            } 
                                    } 
                                        }
                                    
                        }
                        if(obj.getDia()==5){
                                    if(jTable1.getModel().getValueAt(48,z)=="ESTAGIO"){
                                        int y=58;
                                       
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3anoDecimaAula();
                                            } 
                                    } 
                                        }
                            
                        }
                }
                
           
        }
       }
    }

    private void Insere3ano2aulas () throws SQLException {
      
            listaO=objmet.CriaListObjPara3anode2aulas();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                obj=listaO.get(w);     
                if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO" || jTable1.getModel().getValueAt(6,z)=="ESTAGIO"){
                if("Regular".equals(obj.getEixo())){
                    
                    
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){   
                        
                        if(obj.getDia()==1){
                           ChamaDiaUM3de2aulas(obj,z); 
                        }
                        if(obj.getDia()==2){                          
                            ChamaDiaDOIS3de2aulas(obj,z);
                        }
                        if(obj.getDia()==3){
                           ChamaDiaTRES3de2aulas(obj,z);
                        }
                        if(obj.getDia()==4){
                          ChamaDiaQUATRO3de2aulas(obj,z);   
                        }
                        if(obj.getDia()==5){
                            ChamaDiaCINCO3de2aulas(obj,z);
                        }
                }
                
            }if("Profissional".equals(obj.getEixo())){       
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                            ChamaDiaUMProf3de2aulas(obj, z);
                        }
                        if(obj.getDia()==2){
                              ChamaDiaDOISProf3de2aulas(obj, z);
                        }
                        if(obj.getDia()==3){
                            ChamaDiaTRESProf3de2aulas(obj, z);
                        }
                        if(obj.getDia()==4){
                            ChamaDiaQUATROProf3de2aulas(obj, z);
                        }
                        if(obj.getDia()==5){
                            ChamaDiaCINCOProf3de2aulas(obj, z);
                        }    
                        }
                    }
            }
        }
       }
        
        
    }

    private void Insere3ano1aula() throws SQLException {
        listaO=objmet.CriaListObjPara3anode1aula();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                if(!listaO.isEmpty()){
                obj=listaO.get(w);              
                if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO" || jTable1.getModel().getValueAt(6,z)=="ESTAGIO"){
                                    
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){                        
                        if(obj.getDia()==1){
                          ChamaDiaUM3de1aula(obj,z);
                        }
                        if(obj.getDia()==2){                          
                         ChamaDiaDOIS3de1aula(obj,z);
                        }
                        if(obj.getDia()==3){
                           ChamaDiaTRES3de1aula(obj,z);
                        }
                        if(obj.getDia()==4){
                            ChamaDiaQUATRO3de1aula(obj,z);
                        }
                        if(obj.getDia()==5){
                            ChamaDiaCINCO3de1aula(obj,z);
                        }
                }
                
            }
                }
        }
       }
    }

    


    private void InsereTurmasRestantes() {
        
        try {
            System.out.println("insere TR 3 aulas");
            Insere3aulas();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            System.out.println("insere TR 2 aulas");
            Insere2aulas();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            System.out.println("insere TR 1 aula");
            Insere1aula();
        } catch (SQLException ex) {
            Logger.getLogger(Horario2.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }

    private void Insere3aulas() throws SQLException {
        listaO=objmet.CriaListObj3aula();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                obj=listaO.get(w);               
                 if("Profissional".equals(obj.getEixo())){       
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                         if(obj.getDia()==1){
                            ChamaDiaUMProf3aulas(obj, z);
                        }
                        if(obj.getDia()==2){
                            ChamaDiaDOISProf3aulas(obj, z);
                        }
                        if(obj.getDia()==3){
                            ChamaDiaTRESProf3aulas(obj, z);
                        }
                        if(obj.getDia()==4){
                           ChamaDiaQUATROProf3aulas(obj, z); 
                        }
                        if(obj.getDia()==5){
                             ChamaDiaCINCOProf3aulas(obj, z);
                        }
                        }
                    }
        }
       }
    }
    
    private void Insere2aulas() throws SQLException {
        listaO=objmet.CriaListObj2aulas();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){ 
                if(!listaO.isEmpty()){
                obj=listaO.get(w);               
                 
                     
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1 ){
                          ChamaDiaUM(obj,z);  
                        }
                        if(obj.getDia()==2 ){
                           ChamaDiaDOIS(obj,z); 
                        }
                        if(obj.getDia()==3 ){
                            ChamaDiaTRES(obj,z);
                        }
                        if(obj.getDia()==4 ){
                            ChamaDiaQUATRO(obj,z);
                        }
                        if(obj.getDia()==5 ){
                            ChamaDiaCINCO(obj,z);
                        }         
                }
                }  
           
        }
       }
    }
    
    private void Insere1aula() throws SQLException {
         listaO=objmet.CriaListObj();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                obj=listaO.get(w);               
                 
                     
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                          ChamaDiaUM2(obj,z);  
                        }
                        if(obj.getDia()==2){
                           ChamaDiaDOIS2(obj,z); 
                        }
                        if(obj.getDia()==3){
                            ChamaDiaTRES2(obj,z);
                        }
                        if(obj.getDia()==4){
                            ChamaDiaQUATRO2(obj,z);
                        }
                        if(obj.getDia()==5){
                            ChamaDiaCINCO2(obj,z);
                        }         
                }
                
            
        }
       }
    }

    private void RemoveInsere() throws SQLException {
        listaO=objmet.CriaListObjV();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                if(!listaO.isEmpty()){obj=listaO.get(w);               
                 if(!prof2.equals(obj.getNomeprof()) && !prof3.equals(obj.getNomeprof()) && !prof2.equals("") && !prof3.equals("") || !prof2.equals("") && !prof3.equals("") || prof1.equals("")){
                    prof1=obj.getNomeprof(); 
                 }else if(!prof1.equals(obj.getNomeprof()) && !prof3.equals(obj.getNomeprof()) &&  !prof3.equals("") ||  !prof3.equals("") && prof2.equals("") && !prof1.equals(obj.getNomeprof()) && !prof3.equals(obj.getNomeprof()) ) {
                    prof2=obj.getNomeprof();  
                 }else if(!prof1.equals(obj.getNomeprof()) && !prof2.equals(obj.getNomeprof())){
                   prof3=obj.getNomeprof();   
                 }
                     
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                          ChamaDia1SemRetirarAulasComjuntas(obj,z);
                        }
                        if(obj.getDia()==2){
                          ChamaDia2SemRetirarAulasComjuntas(obj,z); 
                        }
                        if(obj.getDia()==3){
                          ChamaDia3SemRetirarAulasComjuntas(obj,z);  
                        }
                        if(obj.getDia()==4){
                          ChamaDia4SemRetirarAulasComjuntas(obj,z);  
                        }
                        if(obj.getDia()==5){
                          ChamaDia5SemRetirarAulasComjuntas(obj,z);  
                        }         
                }
                
                }
        }
       }
    }

    private void RemoveInsere2() throws SQLException {
        listaO=objmet.CriaListObjV();
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
               if(!listaO.isEmpty()){ obj=listaO.get(w);               
                   
                     
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                          ChamaDia1RetirandoAulasComjuntas(obj,z);
                        }
                        if(obj.getDia()==2){
                          ChamaDia2RetirandoAulasComjuntas(obj,z); 
                        }
                        if(obj.getDia()==3){
                          ChamaDia3RetirandoAulasComjuntas(obj,z);  
                        }
                        if(obj.getDia()==4){
                          ChamaDia4RetirandoAulasComjuntas(obj,z);  
                        }
                        if(obj.getDia()==5){
                          ChamaDia5RetirandoAulasComjuntas(obj,z);  
                        }         
                }
               }   
            
        }
       }
    }
    
    private void AlocaNaTabela2(Professor prof, Disciplina disc) throws SQLException {
        listaO=objmet.CriaListObjPorProDisc(prof,disc);
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
                if(!listaO.isEmpty()){obj=listaO.get(w);               
                
                    
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                          ChamaDia1SemRespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==2){
                          ChamaDia2SemRespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==3){
                          ChamaDia3SemRespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==4){
                          ChamaDia4SemRespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==5){
                          ChamaDia5SemRespeitandoAulasNomesmoDia(obj,z);
                        }         
                }
                }   
            
        }
       }
    }
    
    private void AlocaNaTabela(Professor prof, Disciplina disc) throws SQLException {
        listaO=objmet.CriaListObjPorProDisc(prof,disc);
            listaS=seriemet.getList();
        for(int z=0;listaS.size()>z;z++){
            for(int w=0;listaO.size()>w;w++){  
               if(!listaO.isEmpty()){ obj=listaO.get(w);               
                
                     
                    if(jTable1.getColumnName(z).equals(obj.getAnoturma())){
                        if(obj.getDia()==1){
                          ChamaDia1RespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==2){
                          ChamaDia2RespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==3){
                          ChamaDia3RespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==4){
                          ChamaDia4RespeitandoAulasNomesmoDia(obj,z);
                        }
                        if(obj.getDia()==5){
                          ChamaDia5RespeitandoAulasNomesmoDia(obj,z);
                        }         
                }
               }
            
        }
       }
    }
    
    private void ChamaDia1SemRetirarAulasComjuntas   (Objeto obj, int z) throws SQLException {
        for(int y=0;y<=9;y++){
                   if(y==0 && obj!=null){
                       
                                           
                                         if(obj!=null){
                                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                              
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);                                                            
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==1 && obj!=null){
                                            if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==2 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==3 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==4 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==6 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                               
                                            } 
                                           }
                  }
                                        }
                   if(y==7 && obj!=null){
                                            if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==8 && obj!=null){
                                            if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==9 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  
                   
               }
    }
    
    private void ChamaDia2SemRetirarAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                   if(y==12 && obj!=null){
                       
                                          if(obj!=null){
                                        
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                           
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);

                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==13 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                               
                                            } 
                                           }
                   }
                                        }
                  if(y==14 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==15 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==16 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==18 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==19 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==20 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==21 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                 
                   
               }
    }
    
    private void ChamaDia3SemRetirarAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=24;y<=33;y++){
                   if(y==24 && obj!=null){
                                            if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                              jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                              
                                            } 
                                           }
                   }
                                        }
                   if(y==25 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==26 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                 AlocaNaTabela(prof,disc);
                                                                
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==27 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==28 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==30 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==31 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                               
                                            } 
                                           }
                   }
                                        }
                  if(y==32 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==33 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                 jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                               
                                            } 
                                           }
                  }
                                        }
                 
                   
               }
    }

    private void ChamaDia4SemRetirarAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=36;y<=45;y++){
                   if(y==36 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==37 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==38 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==39 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==40 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==42 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==43 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==44 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==45 && obj!=null){
                                         if(obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                 
                   
               }
    }

    private void ChamaDia5SemRetirarAulasComjuntas(Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){ 
                   if(y==48 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                   if(y==49 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==50 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==51 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==52 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==54 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                   if(y==55 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==56 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null && !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                System.out.println("serie:"+obj.getId_serie()+"prof: "+prof.getNome()+" id do prof: "+prof.getId()+"disci: "+disc.getNome()+"id dis: " +disc.getId_disc());
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==57 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                           
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y-1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela(prof,disc);
                                                               
                                            } 
                                           }
                                    }
                                    
                                        }
                 
                   
               }
    }

    private void ChamaDia1RespeitandoAulasNomesmoDia   (Objeto obj, int z) throws SQLException {
         
                for(int y=0;y<=9;y++){
                   if(y==0 && obj!=null){
                      
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==1 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==2 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==3 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==4 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==6 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==7 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==8 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==9 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                              RemoveInsere();
                                            } 
                                    } 
                                        }
                  
                   
               }
    }

    private void ChamaDia2RespeitandoAulasNomesmoDia(Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                   if(y==12 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==13 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==14 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==15 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==16 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==18 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==19 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==20 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==21 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDia3RespeitandoAulasNomesmoDia (Objeto obj, int z) throws SQLException {
         for(int y=24;y<=33;y++){
                   if(y==24 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==25 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==26 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==27 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==28 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==30 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==31 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==32 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==33 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDia4RespeitandoAulasNomesmoDia(Objeto obj, int z) throws SQLException {
           for(int y=36;y<=45;y++){
                   if(y==36 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==37 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==38 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==39 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==40 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==42 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==43 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==44 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==45 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDia5RespeitandoAulasNomesmoDia (Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){
                   if(y==48 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==49 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==50 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==51 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==52 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==54 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                   if(y==55 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                  
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==56 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                RemoveInsere();
                                            } 
                                    } 
                                        }
                  if(y==57 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                               RemoveInsere();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDia1RetirandoAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=0;y<=9;y++){
                   if(y==0 && obj!=null){
                       
                                          
                                         if(obj!=null){
                                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                              
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==1 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==2 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==3 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==4 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if( !obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y+1);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==6 && obj!=null){
                                           if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                               
                                            } 
                                           }
                  }
                                        }
                   if(y==7 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==8 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==9 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if( !obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable1.getModel().getValueAt(y, z))) && !String.valueOf(jTable2.getModel().getValueAt(y+1, z)).equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y);
                                                                pd.setId_dias(1);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  
                   
               }
    }
    
    private void ChamaDia2RetirandoAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                   if(y==12 && obj!=null){
                       
                                           if(obj!=null){
                                        
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                           
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==13 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                               
                                            } 
                                           }
                   }
                                        }
                  if(y==14 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                               profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==15 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==16 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-11);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==18 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==19 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                               profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==20 && obj!=null){
                                         if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==21 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-12);
                                                                pd.setId_dias(2);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                 
                   
               }
    }
    
    private void ChamaDia3RetirandoAulasComjuntas(Objeto obj, int z) throws SQLException {
        for(int y=24;y<=33;y++){
                   if(y==24 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                              
                                            } 
                                           }
                   }
                                        }
                   if(y==25 && obj!=null){
                                           if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==26 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==27 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                               jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==28 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-23);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==30 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==31 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                               
                                            } 
                                           }
                   }
                                        }
                  if(y==32 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==33 && obj!=null){
                                            if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-24);
                                                                pd.setId_dias(3);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                               
                                            } 
                                           }
                  }
                                        }
                 
                   
               }
    }

    private void ChamaDia4RetirandoAulasComjuntas(Objeto obj, int z) throws SQLException {
        for(int y=36;y<=45;y++){
                   if(y==36 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                   if(y==37 && obj!=null){
                                          if(obj!=null){
                                         if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==38 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==39 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==40 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-35);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                materia=String.valueOf(jTable1.getModel().getValueAt( y, z));
                                                                professor=String.valueOf(jTable2.getModel().getValueAt( y, z));
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==42 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                   if(y==43 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                   }
                                        }
                  if(y==44 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                  }
                                        }
                  if(y==45 && obj!=null){
                                           if(obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&  !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-36);
                                                                pd.setId_dias(4);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                 
                   
               }
    }

    private void ChamaDia5RetirandoAulasComjuntas (Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){ 
                   if(y==48 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                   if(y==49 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==50 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==51 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&    !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==52 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-47);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==54 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                   if(y==55 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==56 && obj!=null){
                                          if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                               if( !obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) && jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                AlocaNaTabela2(prof,disc);
                                                                
                                            } 
                                           }
                                    }
                                        }
                  if(y==57 && obj!=null){
                                           if(obj!=null){
                                        if(jTable1.getColumnName(z).equals(obj.getAnoturma()) ){
                                           
                                               if(!obj.getNomeprof().equals(String.valueOf(jTable2.getModel().getValueAt(y, z))) &&  jTable1.getModel().getValueAt(y, z)!=null &&   !String.valueOf(jTable1.getModel().getValueAt(y, z)).equals("ESTAGIO") && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                                prof.setNome(String.valueOf(jTable2.getModel().getValueAt(y, z)));
                                                                disc.setNome(String.valueOf(jTable1.getModel().getValueAt(y, z)));
                                                                prof.setId(profmet.BuscaId(prof));
                                                                disc.setId_disc(discmet.BuscaIDDisciplina(disc));
                                                                hamet.Adicionar(obj.getId_serie(), prof.getId(), disc.getId_disc(), 1);
                                                                prof.setCarga_horaria(profmet.abuscaCHProf(prof));
                                                                profmet.alterarCHProf(prof);
                                                                pd.setId_aula(y-48);
                                                                pd.setId_dias(5);
                                                                pd.setId_prof(prof.getId());
                                                                profdiasmet.Adicionar2(pd);
                                                                jTable1.setValueAt("", y, z);
                                                                jTable2.setValueAt("", y, z);
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                              AlocaNaTabela2(prof,disc);
                                                               
                                            } 
                                           }
                                    }
                                 
                                        }
                 
                   
               }
    }

    private void ChamaDia1SemRespeitandoAulasNomesmoDia (Objeto obj, int z) throws SQLException {
         
                for(int y=0;y<=9;y++){
                   if(y==0 && obj!=null){
                                         
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==1 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==2 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==3 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==4 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==6 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==7 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==8 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==9 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                              RemoveInsere2();
                                            } 
                                     
                                        }
                  
                   
               }
    }

    private void ChamaDia2SemRespeitandoAulasNomesmoDia(Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                   if(y==12 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==13 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==14 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==15 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==16 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==18 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==19 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==20 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==21 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                 
                   
               }
    }

    private void ChamaDia3SemRespeitandoAulasNomesmoDia (Objeto obj, int z) throws SQLException {
         for(int y=24;y<=33;y++){
                   if(y==24 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                    
                                        }
                   if(y==25 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==26 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==27 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==28 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==30 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==31 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==32 && obj!=null){
                                       
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==33 && obj!=null){
                                         
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                 
                   
               }
    }

    private void ChamaDia4SemRespeitandoAulasNomesmoDia(Objeto obj, int z) throws SQLException {
           for(int y=36;y<=45;y++){
                   if(y==36 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==37 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==38 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==39 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==40 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==42 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==43 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==44 && obj!=null){
                                     
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==45 && obj!=null){
                                        
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                 
                   
               }
    }

    private void ChamaDia5SemRespeitandoAulasNomesmoDia (Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){
                   if(y==48 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                               
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                   if(y==49 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==50 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==51 && obj!=null){
                                         
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                    
                                        }
                  if(y==52 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==54 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                   if(y==55 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==56 && obj!=null){
                                           
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                                RemoveInsere2();
                                            } 
                                     
                                        }
                  if(y==57 && obj!=null){
                                          
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                obj=null;
                                                               RemoveInsere2();
                                            } 
                                     
                                        }
                 
                   
               }
    }
    

        private void ChamaDiaUM   (Objeto obj, int z) throws SQLException {
         
                for(int y=0;y<=9;y++){
                    if(y==0 || y==2 || y==3 || y==4 ){
                        if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y+1);
                        }
                    }else if(y==6 || y==8){
                        if( obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y);
                        }
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==0 || y==2 || y==3 || y==6 || y==8 && !listaO2.isEmpty()){
                         if(y==0 && obj!=null ){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==2 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==3 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                        if(y==6 && obj!=null){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==8 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                               Insere2aulas();
                                            } 
                                    }  
                       }
                   
                   
                   
                   }
                   
                   
                   
                }
    }

    private void ChamaDiaDOIS (Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                    if(y==12 || y==14 || y==15   ){
                        if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-11);
                        }
                    }else if(y==18 || y==20){
                        if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-12);
                        }
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==12 || y==14 || y==15 || y==18 || y==20 && !listaO2.isEmpty()){
                         if(y==12 && obj!=null ){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==14 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==15 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                        if(y==18 && obj!=null){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==20 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                   
                   
                   
                   }
                   
                   
                   
                }
    }

    private void ChamaDiaTRES(Objeto obj, int z) throws SQLException {
         for(int y=24;y<=33;y++){
                    if(y==24 || y==26 || y==27 ){
                        if( obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-23);
                        }
                    }else if( y==30 || y==32){
                        if( obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-24);
                        }
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==24 || y==26 || y==27 || y==30 || y==32 && !listaO2.isEmpty()){
                         if(y==24 && obj!=null ){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                obj=null; 
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==26 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==27 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                        if(y==30 && obj!=null){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==32 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                   
                   
                   
                   }
                   
                   
                   
                }
    }

    private void ChamaDiaQUATRO(Objeto obj, int z) throws SQLException {
           for(int y=36;y<=45;y++){
                    if(y==36 || y==38 || y==39 ){
                        if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-35);
                        }
                    }else if( y==42 || y==44){
                        if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-36);
                        }
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==36 || y==38 || y==39 || y==42 || y==44 && !listaO2.isEmpty()){
                         if(y==36 && obj!=null ){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==38 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==39 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                        if(y==42 && obj!=null){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==44 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                   
                   
                   
                   }
                   
                   
                   
                }
    }

    private void ChamaDiaCINCO (Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){
                    if(y==48 || y==50 || y==51 ){
                        if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-47);
                        }
                    }else if( y==54 || y==56){
                        if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-48);
                        }
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==48 || y==50 || y==51 || y==54 || y==56 && !listaO2.isEmpty()){
                         if(y==48 && obj!=null ){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==50 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==51 && obj!=null){
                           if( jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                        if(y==54 && obj!=null){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }if(y==56 && obj!=null){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                obj=null;
                                                                Insere2aulas();
                                            } 
                                    }  
                       }
                   
                   
                   
                   }
                   
                   
                   
                }
    }

   

    private void ChamaDiaUM2(Objeto obj, int z) throws SQLException {
         
                for(int y=0;y<=9;y++){
                   if(y==0 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==1 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==2 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==3 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==4 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==6 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==7 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==8 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==9 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                              Insere1aula();
                                            } 
                                    } 
                                        }
                  
                   
               }
    }

    private void ChamaDiaDOIS2 (Objeto obj, int z) throws SQLException {
        for(int y=12;y<=21;y++){
                   if(y==12 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==13 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==14 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==15 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==16 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==18 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==19 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==20 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==21 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDiaTRES2(Objeto obj, int z) throws SQLException {
         for(int y=24;y<=33;y++){
                   if(y==24 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==25 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==26 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==27 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==28 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==30 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==31 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==32 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null; 
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==33 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDiaQUATRO2(Objeto obj, int z) throws SQLException {
           for(int y=36;y<=45;y++){
                   if(y==36 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==37 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==38 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==39 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==40 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==42 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==43 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==44 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==45 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

    private void ChamaDiaCINCO2 (Objeto obj, int z) throws SQLException {
        for(int y=48;y<=57;y++){
                   if(y==48 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==49 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==50 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==51 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==52 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==54 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                   if(y==55 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==56 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                                Insere1aula();
                                            } 
                                    } 
                                        }
                  if(y==57 && obj!=null){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                obj=null;
                                                               Insere1aula();
                                            } 
                                    } 
                                        }
                 
                   
               }
    }

   

    private void ChamaDiaUM3de2aulas (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO"){
                
                
               for(int y=6;y<=10;y++){
                    if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y);
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==6 || y==8 || y==9){
                       if(y==6){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==8){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc() .equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==9){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(6,z)=="ESTAGIO"){
                
                for(int y=0;y<=4;y++){
                     if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y+1);
                     }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==0 || y==2 || y==3){
                       if(y==0){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==2){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==3){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }
        
    }
    
    private void ChamaDiaDOIS3de2aulas (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(12,z)=="ESTAGIO"){
                
                
               for(int y=18;y<=22;y++){
                    if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-12);
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==18 || y==20 || y==21){
                       if(y==18){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==20){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==21){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(18,z)=="ESTAGIO"){
                
                for(int y=12;y<=16;y++){
                     if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-11);
                     }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==12 || y==14 || y==15){
                       if(y==12){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==14){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==15){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }       
    }

    private void ChamaDiaTRES3de2aulas(Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(24,z)=="ESTAGIO"){
                
                
               for(int y=30;y<=34;y++){
                    if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-24);
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==30 || y==32 || y==33){
                       
                       if(y==30){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==32){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==33){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(30,z)=="ESTAGIO"){
                
                for(int y=24;y<=28;y++){
                     if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-23);
                     }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==24 || y==26 || y==27){
                       if(y==24){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==26){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==27){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }        
    }

    private void ChamaDiaQUATRO3de2aulas (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(36,z)=="ESTAGIO"){
                
                
               for(int y=42;y<=46;y++){
                    if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-36);
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==42 || y==44 || y==45){
                       
                       if(y==42){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==44){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==45){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                               Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(42,z)=="ESTAGIO"){
                
                for(int y=36;y<=40;y++){
                     if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-35);
                     }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==36 || y==38 || y==39){
                       if(y==36){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==38){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==39){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }  
    }

    private void ChamaDiaCINCO3de2aulas(Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(48,z)=="ESTAGIO"){
                
                
               for(int y=54;y<=58;y++){
                    if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-48);
                    }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==54 || y==56 || y==57){
                       
                       if(y==54){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==56){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==57){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(54,z)=="ESTAGIO"){
                
                for(int y=48;y<=52;y++){
                     if(obj!=null){
                   listaO2=objmet.CriaListObj2(obj,y-47);
                     }
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(y==48 || y==50 || y==51){
                       if(y==48){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==50){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==51){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }
    }

    private void ChamaDiaUM3de1aula (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO"){
                
                
               
               for(int y=6;y<=10;y++){
                   if(y==6){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || obj.getNomeprof()!=jTable2.getModel().getValueAt(7,z)) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==7){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==8){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==9){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==10){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
            
            }else if(jTable1.getModel().getValueAt(6,z)=="ESTAGIO"){
                
               for(int y=0;y<=4;y++){
                   if(y==0){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==1){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==2){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==3){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==4){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==1 && obj.getAula()==y+1){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
                
            }
    }

    private void ChamaDiaDOIS3de1aula (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(12,z)=="ESTAGIO"){
                
                
               for(int y=18;y<=22;y++){
                   if(y==18){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==19){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==20){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==21){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==22){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-12){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
            
            }else if(jTable1.getModel().getValueAt(18,z)=="ESTAGIO"){
               for(int y=12;y<=16;y++){
                   if(y==12){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==13){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==14){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==15){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==16){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==2 && obj.getAula()==y-11){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
                
            }
    }

    private void ChamaDiaTRES3de1aula (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(24,z)=="ESTAGIO"){
              for(int y=30;y<=34;y++){
                   if(y==30){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==31){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==32){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==33){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==34){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-24){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
            
            }else if(jTable1.getModel().getValueAt(30,z)=="ESTAGIO"){
              for(int y=24;y<=28;y++){
                   if(y==24){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==25){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==26){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==27){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==28){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==3 && obj.getAula()==y-23){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
                
            }
    }

    private void ChamaDiaQUATRO3de1aula (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(36,z)=="ESTAGIO"){
              for(int y=42;y<=46;y++){
                   if(y==42){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==43){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==44){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==45){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==46){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-36){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
            
            }else if(jTable1.getModel().getValueAt(42,z)=="ESTAGIO"){
                for(int y=36;y<=40;y++){
                   if(y==36){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==37){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==38){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==39){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==40){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==4 && obj.getAula()==y-35){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
                
            }
    }

    private void ChamaDiaCINCO3de1aula (Objeto obj,int z) throws SQLException {
            
            if(jTable1.getModel().getValueAt(48,z)=="ESTAGIO"){
              for(int y=54;y<=58;y++){
                   if(y==54){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==55){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==56){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==57){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==58){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
            
            }else if(jTable1.getModel().getValueAt(54,z)=="ESTAGIO"){
               for(int y=48;y<=52;y++){
                   if(y==48){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==49){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==50){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==51){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==52){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   
               }
                
                
            }else {
           for(int y=48;y<=57;y++){
                   if(y==48){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==49){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==50){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==51){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==52){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-47){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==54){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                   if(y==55){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==56){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                  if(y==57){
                                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && obj.getCH()>=1 && obj.getHA()>=1 && obj.getDia()==5 && obj.getAula()==y-48){
                                                             
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                objmet.Remove1daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove1diasaulasdisponivel(obj);
                                                                 Insere3ano1aula();
                                            } 
                                    } 
                                        }
                 
                   
               }

                        }
        
    }
    
   private void ChamaDiaUMProf3aulas  (Objeto obj, int z) throws SQLException {
        int y=2;
                    
                        if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y+1);
                        listaO3=objmet.CriaListObj2(obj,y+2);
                        if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                        }
                        
                    
                    
                   
                   
                         
                          if(obj.getCH()>=3 && obj.getHA()>=3 && !listaO2.isEmpty() && !listaO3.isEmpty()){
                              if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && jTable1.getModel().getValueAt(y+2, z)==null && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2 && obj3.getAula()==y+3){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                jTable1.getModel().setValueAt(obj3.getNomedisc(), y+2, z);
                                                                jTable2.getModel().setValueAt(obj3.getNomeprof(), y+2, z);
                                                                objmet.Remove3daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove3diasaulasdisponivel(obj,obj2,obj3);
                                                                
                                                                Insere3aulas();
                                            } 
                                    }  
                          }
                       
                        
                   
                   
                   
                   
                   
                   
                   
                
    }

    private void ChamaDiaDOISProf3aulas(Objeto obj, int z) throws SQLException {
         int y=14;
                    
                         if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-11);
                        listaO3=objmet.CriaListObj2(obj,(y-11)+1);
                         }
                    
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   
                         
                           if(obj.getCH()>=3 && obj.getHA()>=3 && !listaO2.isEmpty() && !listaO3.isEmpty()){
                               if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) && !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && jTable1.getModel().getValueAt(y+2, z)==null  && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1 && obj3.getAula()==(y-11)+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                jTable1.getModel().setValueAt(obj3.getNomedisc(), y+2, z);
                                                                jTable2.getModel().setValueAt(obj3.getNomeprof(), y+2, z);
                                                                objmet.Remove3daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove3diasaulasdisponivel(obj,obj2,obj3);
                                                                Insere3aulas();
                                            } 
                                    }  
                           }

    }

    private void ChamaDiaTRESProf3aulas(Objeto obj, int z) throws SQLException {
        int y=26;
                    
                         if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-23);
                         listaO3=objmet.CriaListObj2(obj,(y-23)+1);
                         }
                    
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   
                       
                           if(obj.getCH()>=3 && obj.getHA()>=3 && !listaO2.isEmpty() && !listaO3.isEmpty()){
                              if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && jTable1.getModel().getValueAt(y+2, z)==null && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1 && obj3.getAula()==(y-23)+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                jTable1.getModel().setValueAt(obj3.getNomedisc(), y+2, z);
                                                                jTable2.getModel().setValueAt(obj3.getNomeprof(), y+2, z);
                                                                objmet.Remove3daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove3diasaulasdisponivel(obj,obj2,obj3);
                                                                Insere3aulas();
                                            } 
                                    }   
                           }

    }

    private void ChamaDiaQUATROProf3aulas(Objeto obj, int z) throws SQLException {
        int y=38;
                    
                         if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-35);
                        listaO3=objmet.CriaListObj2(obj,(y-35)+1);
                         }
                    
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   
                            if(obj.getCH()>=3 && obj.getHA()>=3 && !listaO2.isEmpty() && !listaO3.isEmpty()){
                                if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && jTable1.getModel().getValueAt(y+2, z)==null  && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1 && obj3.getAula()==(y-35)+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                jTable1.getModel().setValueAt(obj3.getNomedisc(), y+2, z);
                                                                jTable2.getModel().setValueAt(obj3.getNomeprof(), y+2, z);
                                                                objmet.Remove3daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove3diasaulasdisponivel(obj,obj2,obj3);
                                                                Insere3aulas();
                                            } 
                                    }  
                            }
                       }
  

    private void ChamaDiaCINCOProf3aulas(Objeto obj, int z) throws SQLException {
              
               int y=50;
                    
                         if(obj!=null){
                        listaO2=objmet.CriaListObj2(obj,y-47);
                        listaO3=objmet.CriaListObj2(obj,(y-47)+1);
                         }
                   
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                  
                           if(obj.getCH()>=3 && obj.getHA()>=3 && !listaO2.isEmpty() && !listaO3.isEmpty()){
                               if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z)))  && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z)))){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && jTable1.getModel().getValueAt(y+2, z)==null && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1 && obj3.getAula()==(y-47)+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                jTable1.getModel().setValueAt(obj3.getNomedisc(), y+2, z);
                                                                jTable2.getModel().setValueAt(obj3.getNomeprof(), y+2, z);
                                                                objmet.Remove3daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove3diasaulasdisponivel(obj,obj2,obj3);
                                                                Insere3aulas();
                                            } 
                                    }  
                           }
                       }


    private void ChamaDiaUMProf3de2aulas  (Objeto obj,int z) throws SQLException {
   if(jTable1.getModel().getValueAt(0,z)=="ESTAGIO"){
                
                
               for(int y=6;y<=10;y++){
                   
                   listaO2=objmet.CriaListObj2(obj,y);
                   listaO3=objmet.CriaListObj2(obj,y+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==6 || y==8 || y==9){
                       if(y==6){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(9,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(9,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==8){
                           
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc() .equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(10,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(10,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                            
                       }if(y==9){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(6,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(6,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(7,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(7,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(8,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(8,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y && obj2.getAula()==y+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(6,z)=="ESTAGIO"){
                
                for(int y=0;y<=4;y++){
                   listaO2=objmet.CriaListObj2(obj,y+1);
                   listaO3=objmet.CriaListObj2(obj,y+2);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==0 || y==2 || y==3){
                       if(y==0){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(3,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(3,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==2){
                       
                               
                           
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(4,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(4,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    } 
                           
                       }if(y==3){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(0,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(0,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(1,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(1,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(2,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(2,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==1 && obj.getAula()==y+1 && obj2.getAula()==y+2){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }    
            
    }
    
    private void ChamaDiaDOISProf3de2aulas (Objeto obj, int z) throws SQLException  {
      if(jTable1.getModel().getValueAt(12,z)=="ESTAGIO"){
                
                
               for(int y=18;y<=22;y++){
                   listaO2=objmet.CriaListObj2(obj,y-12);
                   listaO3=objmet.CriaListObj2(obj,(y-12)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==18 || y==20 || y==21){
                       if(y==18){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(21,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(21,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==20){
                          
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(22,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(22,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==21){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(20,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(20,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(18,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(18,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(19,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(19,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-12 && obj2.getAula()==(y-12)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
            }else if(jTable1.getModel().getValueAt(18,z)=="ESTAGIO"){
                
                for(int y=12;y<=16;y++){
                   listaO2=objmet.CriaListObj2(obj,y-11);
                   listaO3=objmet.CriaListObj2(obj,(y-11)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==12 || y==14 || y==15){
                       if(y==12){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(15,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(15,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==14){
                           
                               
                           
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(16,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(16,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==15){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(14,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(14,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(12,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(12,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(13,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(13,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==2 && obj.getAula()==y-11 && obj2.getAula()==(y-11)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }
    }

    private void ChamaDiaTRESProf3de2aulas(Objeto obj, int z) throws SQLException {
       if(jTable1.getModel().getValueAt(24,z)=="ESTAGIO"){
                
                
               for(int y=30;y<=34;y++){
                   listaO2=objmet.CriaListObj2(obj,y-24);
                   listaO3=objmet.CriaListObj2(obj,(y-24)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==30 || y==32 || y==33){
                       
                       if(y==30){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(33,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(33,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==32){
                          
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(34,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(34,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==33){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(32,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(32,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(30,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(30,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(31,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(31,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-24 && obj2.getAula()==(y-24)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
            }else if(jTable1.getModel().getValueAt(30,z)=="ESTAGIO"){
                
                for(int y=24;y<=28;y++){
                   listaO2=objmet.CriaListObj2(obj,y-23);
                   listaO3=objmet.CriaListObj2(obj,(y-23)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==24 || y==26 || y==27){
                       if(y==24){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(27,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(27,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==26){
                           
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(28,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(28,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==27){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(26,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(26,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(24,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(24,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(25,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(25,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==3 && obj.getAula()==y-23 && obj2.getAula()==(y-23)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }
    }

    private void ChamaDiaQUATROProf3de2aulas(Objeto obj, int z) throws SQLException {
        if(jTable1.getModel().getValueAt(36,z)=="ESTAGIO"){
                
                
               for(int y=42;y<=46;y++){
                   listaO2=objmet.CriaListObj2(obj,y-36);
                   listaO3=objmet.CriaListObj2(obj,(y-36)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==42 || y==44 || y==45){
                       
                       if(y==42){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(45,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(45,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==44){
                       
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(46,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(46,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==45){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(44,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(44,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(42,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(42,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(43,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(43,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-36 && obj2.getAula()==(y-36)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
            }else if(jTable1.getModel().getValueAt(42,z)=="ESTAGIO"){
                
                for(int y=36;y<=40;y++){
                   listaO2=objmet.CriaListObj2(obj,y-35);
                  listaO3=objmet.CriaListObj2(obj,(y-35)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==36 || y==38 || y==39){
                       if(y==36){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(39,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(39,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==38){
                          
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(40,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(40,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==39){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(38,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(38,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(36,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(36,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(37,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(37,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==4 && obj.getAula()==y-35 && obj2.getAula()==(y-35)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               
            
                   
               }
                
                
            }
    }

    private void ChamaDiaCINCOProf3de2aulas(Objeto obj, int z) throws SQLException {
       if(jTable1.getModel().getValueAt(48,z)=="ESTAGIO"){
                
                
               for(int y=54;y<=58;y++){
                   listaO2=objmet.CriaListObj2(obj,y-48);
                   listaO3=objmet.CriaListObj2(obj,(y-48)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==54 || y==56 || y==57){
                       
                       if(y==54){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(57,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(57,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                              
                              if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==56){
                         
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(58,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(58,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                           
                       }if(y==57){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(56,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(56,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(54,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(54,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(55,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(55,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-48 && obj2.getAula()==(y-48)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
            
            }else if(jTable1.getModel().getValueAt(54,z)=="ESTAGIO"){
                
                for(int y=48;y<=52;y++){
                   listaO2=objmet.CriaListObj2(obj,y-47);
                   listaO3=objmet.CriaListObj2(obj,(y-47)+1);
                   if(!listaO2.isEmpty()){                                
                                obj2=listaO2.get(0);
                                }
                   if(!listaO3.isEmpty()){                                
                                obj3=listaO3.get(0);
                                }
                   if(y==48 || y==50 || y==51){
                       if(y==48){
                          if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(51,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(51,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }if(y==50){
                          
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(52,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(52,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }
                           
                       }if(y==51){
                           if(jTable1.getColumnName(z).equals(obj.getAnoturma()) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(50,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(50,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(48,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(48,z))) && (!obj.getNomedisc().equals(jTable1.getModel().getValueAt(49,z)) || !obj.getNomeprof().equals(jTable2.getModel().getValueAt(49,z))) ){
                                                if(jTable1.getModel().getValueAt(y, z)==null  && jTable1.getModel().getValueAt(y+1, z)==null && obj.getCH()>=2 && obj.getHA()>=2 && obj.getDia()==5 && obj.getAula()==y-47 && obj2.getAula()==(y-47)+1){
                                                         
                                                                jTable1.getModel().setValueAt(obj.getNomedisc(), y, z);
                                                                jTable2.getModel().setValueAt(obj.getNomeprof(), y, z);
                                                                jTable1.getModel().setValueAt(obj2.getNomedisc(), y+1, z);
                                                                jTable2.getModel().setValueAt(obj2.getNomeprof(), y+1, z);
                                                                objmet.Remove2daCHeHA(obj.getId_prof(),obj.getCH(),obj.getHA(),obj.getId_HA());
                                                                objmet.Remove2diasaulasdisponivel(obj,obj2);
                                                                 
                                                                Insere3ano2aulas();
                                            } 
                                    }  
                       }
                   }
               }
                
                
            }
        
    }

    private void DeslocaAulas() throws SQLException {
        listaO=objmet.CriaListObj();
        listaS=seriemet.getList();
         for(int w=0;listaO.size()>w;w++){   
             obj=listaO.get(w); 
//            for(int i=0;i<59;i++){
//                for(int l=0;l<listaS.size();l++){
//                if(obj.getNomeprof().equals(jTable2.getModel().getValueAt(i,l))){
                     
                    System.out.println("professores quen se repetem: "+prof1+"+"+prof2+"+"+prof3);
                
//            }
//                }
//                
//            }
        }  
           
        }

private void EnviaDadosRelProf   (int j) {
        Relatorio_Prof rp=new Relatorio_Prof();
        for(int l=0;l<j;l++){
            rp.setId_serie(objmet.BuscaIdSerie(jTable1.getColumnName(l)));  
            for(int i=0;i<59;i++){
            if(i==0 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(1); 
                System.out.println(rp.getNome_prof()+rp.getId_prof());
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==1 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(2);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==2 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(3);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==3 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(4);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==4 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(5);  
                objmet.AdicionaRelatorioProf(rp);
            } 
            if(i==6 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(6);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==7 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(7);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==8 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(8);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==9 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(9);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==10 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && jTable1.getModel().getValueAt(i,l)!=null){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(1);
                rp.setAula(10);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==12 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(1);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==13 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(2);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==14 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(3);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==15 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(4);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==16 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(5);  
                objmet.AdicionaRelatorioProf(rp);
            } 
            if(i==18 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(6);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==19 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(7);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==20 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(8);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==21 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(9);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==22 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && jTable1.getModel().getValueAt(i,l)!=null){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(2);
                rp.setAula(10);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==24 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(1);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==25 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(2);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==26 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(3);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==27 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(4);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==28 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(5);  
                objmet.AdicionaRelatorioProf(rp);
            } 
            if(i==30 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(6);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==31 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(7);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==32 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(8);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==33 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(9);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==34 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && jTable1.getModel().getValueAt(i,l)!=null){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(3);
                rp.setAula(10);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==36 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(1);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==37 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(2);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==38 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(3);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==39 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(4);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==40 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(5);  
                objmet.AdicionaRelatorioProf(rp);
            } 
            if(i==42 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(6);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==43 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(7);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==44 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(8);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==45 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(9);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==46 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && jTable1.getModel().getValueAt(i,l)!=null){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(4);
                rp.setAula(10);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==48 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(1);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==49 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(2);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==50 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(3);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==51 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(4);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==52 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(5);  
                objmet.AdicionaRelatorioProf(rp);
            } 
            if(i==54 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(6);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==55 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(7);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==56 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(8);  
                objmet.AdicionaRelatorioProf(rp);
            }     
            if(i==57 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && !"".equals(jTable1.getModel().getValueAt(i,l))){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(9);  
                objmet.AdicionaRelatorioProf(rp);
            }  
            if(i==58 && !"ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))) && jTable1.getModel().getValueAt(i,l)!=null){
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l)));rp.setNome_prof(String.valueOf(jTable2.getModel().getValueAt(i, l)));
                disc.setNome(rp.getNome_disc());prof.setNome(rp.getNome_prof());
                rp.setId_disc(discmet.BuscaIDDisciplina(disc));rp.setId_prof(profmet.BuscaId(prof));
                prof.setId(rp.getId_prof());rp.setCh_depois(profmet.abuscaCHProf(prof));rp.setCh_antes(profmet.buscaCHantes(prof));
                rp.setNome_serie(seriemet.BuscaNomeSerie(rp.getId_serie()));rp.setTurma(seriemet.BuscaTurma(rp.getId_serie()));
                rp.setDias(5);
                rp.setAula(10);  
                objmet.AdicionaRelatorioProf(rp);
            }  
                
            }
        }   
    }

    private void Envia_Rel_Turmas(int j) {
         Relatorio_Prof rp=new Relatorio_Prof();
        for(int l=0;l<j;l++){
            rp.setId_serie(objmet.BuscaIdSerie(jTable1.getColumnName(l)));  
            for(int i=0;i<59;i++){
            if(i==0){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(1); 
                
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==1 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(2);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==2 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(3);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==3){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(4);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==4 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(5);  
                objmet.AdicionaRelatorioTurmas(rp);
            }
            if(i==6 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(6);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==7 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(7);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==8 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(8);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==9 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(9);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
            if(i==10 && jTable1.getModel().getValueAt(i,l)!=null){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(1);
                rp.setAula(10);  
                objmet.AdicionaRelatorioTurmas(rp);
            }
            if(i==12 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(1);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==13 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(2);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==14 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(3);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==15 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(4);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==16){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(5);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            if(i==18 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(6);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==19 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(7);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==20 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(8);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==21 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(9);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
            if(i==22 && jTable1.getModel().getValueAt(i,l)!=null){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(2);
                rp.setAula(10);  
                objmet.AdicionaRelatorioTurmas(rp);
            }
            if(i==24 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(1);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==25 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(2);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==26 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(3);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==27 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(4);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==28 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(5);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            if(i==30 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(6);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==31 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(7);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==32 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(8);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==33 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(9);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
            if(i==34  && jTable1.getModel().getValueAt(i,l)!=null){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(3);
                rp.setAula(10);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            if(i==36 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(1);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==37 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(2);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==38 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(3);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==39 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(4);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==40 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(5);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            if(i==42 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(6);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==43 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(7);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==44 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(8);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==45 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(9);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
            if(i==46  && jTable1.getModel().getValueAt(i,l)!=null){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(4);
                rp.setAula(10);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            
            if(i==48 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(1);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==49 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(2);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==50 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(3);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==51 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(4);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==52 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(5);  
                objmet.AdicionaRelatorioTurmas(rp);
            } 
            if(i==54 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(6);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==55 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(7);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==56 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(8);  
                objmet.AdicionaRelatorioTurmas(rp);
            }     
            if(i==57 ){
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(9);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
            if(i==58 && jTable1.getModel().getValueAt(i,l)!=null){
                
                if("ESTAGIO".equals(String.valueOf(jTable1.getModel().getValueAt(i,l))))
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))); 
                else
                rp.setNome_disc(String.valueOf(jTable1.getModel().getValueAt(i, l))+" - "+String.valueOf(jTable2.getModel().getValueAt(i, l)));                                          
                rp.setDias(5);
                rp.setAula(10);  
                objmet.AdicionaRelatorioTurmas(rp);
            }  
                
            }
        }  
    }
    

    
    















   
   


}


